<?php
// +----------------------------------------------------------------------
// | Yzncms [ 御宅男工作室 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2007 http://yzncms.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: fastadmin: https://www.fastadmin.net/
// +----------------------------------------------------------------------
namespace app\admin\controller\districts;

use app\admin\model\CarModel;
use app\admin\model\College;
use app\admin\model\UserModel;
use app\common\controller\Adminbase;
use app\common\model\AliPay;
use app\common\model\BannerModel;
use app\common\model\DistrictsModel;
use app\common\model\MemberModel;
use app\common\model\RebateLog;
use util\Tree;


class Cases extends Adminbase
{

    protected function initialize()
    {
        parent::initialize();
        $this->modelClass = new \app\common\model\NoticeModel();
    }

    public function index()
    {
        $data = (new DistrictsModel())->where(['tag' => 'cases'])->find();

        if ($this->request->isPost()) {
            $this->token();
            $params = $this->request->post('');
            try {
                $data->allowField(true)->save($params);
            } catch (\Exception $e) {
                $this->error($e->getMessage());
            }
            $this->success("修改成功！");
        }

        $this->assign('data',$data);
        return $this->fetch('edit');
    }
}
